#ifndef __SYSTEM_H_
#define __SYSTEM_H_

#define ID 2

#define BAUD_RATE_1200 26 //25
#define UART_BRGH_ENABLE 1
#define UART_RXINV_ENABLE 0
#define UART_UTXINV_ENABLE 1

#define LED LATAbits.LATA3
#define LED_TRIS TRISAbits.TRISA3

#define TX PORTBbits.RB14
#define TX_TRIS TRISBbits.TRISB14

#define RF_PWR PORTAbits.RA2
#define RF_PWR_TRIS TRISAbits.TRISA2

#define TC77_PWR PORTBbits.RB9
#define TC77_PWR_TRIS TRISBbits.TRISB9

#define ANALOG_PIN_CONFIG 0b1111111111111100

#define PIR_SENSOR_AN 0
#define LIGHT_SENSOR_AN 1

#define HIGH_SENSITIVITY

#ifdef HIGH_SENSITIVITY
#define PIR_DETECTION_THRESHOLD 10
#define PIR_STABILITY_THRESHOLD 5
#define PIR_WAIT_TO_STABILIZE 1
#endif

#ifndef HIGH_SENSITIVITY
#define PIR_DETECTION_THRESHOLD 2
#define PIR_STABILITY_THRESHOLD 1
#define PIR_WAIT_TO_STABILIZE 1
#endif

#define TC77_CS PORTAbits.RA6
#define TC77_CS_TRIS TRISAbits.TRISA6
#define TC77_PWR LATBbits.LATB9
#define TC77_PWR_TRIS TRISBbits.TRISB9

#endif

